package sample
{
	public class Order
	{
		private var product:String;
		private var quantity:int;
		private var filled:Boolean = false; 
		
		public function Order(product:String, quantity:int)
		{
			this.product = product;
			this.quantity = quantity;
			filled = false;
		}
		
		public function fill(warehouse:IWarehouse):void 
		{
			if(warehouse.getInventory(product)>=quantity) 
			{
				warehouse.remove(product,quantity);
				filled = true;
			}
		}
		
		public function isFilled():Boolean 
		{
			return filled;
		}
	}
}